home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Programming / RxMUI / Examples / ic.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2001-05-24  |  2.0 KB  |  78 lines

  1. /**/
  2.  
  3. signal on halt
  4. signal on break_c
  5.  
  6. l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  7. if AddLibrary("rxmui.library")~=0 then exit
  8.  
  9. call RxMUIOpt("debugmode showerr")
  10. call CreateApp
  11. call HandleApp
  12. /* never reached */
  13. /***********************************************************************/
  14. HandleApp: procedure
  15.  
  16.     ctrl_c=2**12
  17.     do forever
  18.         call NewHandle("app","h",ctrl_c)
  19.         if and(h.signals,ctrl_c)>0 then exit
  20.         select
  21.             when h.event="QUIT" then exit
  22.             otherwise interpret h.event
  23.         end
  24.     end
  25.     /* never reached */
  26. /***********************************************************************/
  27. err: procedure expose sigl rxmuierror
  28. parse arg res
  29. say sigl "["res"]"
  30.     say getrxmuistring(res) "in line" sigl-1 rxmuierror
  31.     exit
  32. /***********************************************************************/
  33. CreateApp: procedure
  34.  
  35.     app.Title="IconExample"
  36.     app.Version="$VER: IconExample 1.0 (12.10.2000)"
  37.     app.Copyright="©2000, alfie"
  38.     app.Author="alfie"
  39.     app.Description="IconExample"
  40.     app.Base="RXMUIEXAMPLE"
  41.     app.SubWindow="win"
  42.      win.ID="MAIN"
  43.      win.Title="IconExample"
  44.      win.Contents="MGROUP"
  45.  
  46.       mgroup.0=vspace()
  47.       mgroup.1="gg"
  48.        gg.class="group"
  49.        gg.horiz=1
  50.         gg.0=hspace()
  51.         gg.1="ic"
  52.          ic.class="icon"
  53.          ic.name="sys:disk"
  54.          ic.inputmode="relverify"
  55.          ic.frame="button"
  56.         gg.2=hspace()
  57.       mgroup.2=vspace()
  58.  
  59.     res=NewObj("APPLICATION","APP")
  60.     if res~=0 then call err(res)
  61.  
  62.     call set("win","open",1)
  63.     call getattr("win","open","o")
  64.     if o=0 then do
  65.         say "can't open window"
  66.         exit
  67.     end
  68.  
  69.     call Notify("win","CloseRequest",1,"app","ReturnID","quit")
  70.     call Notify("ic","pressed",0,"app","return","say 'ic pressed'")
  71.  
  72.     return
  73. /***********************************************************************/
  74. halt:
  75. break_c:
  76.     exit
  77. /**************************************************************************/
  78.